package com.xhs.modular.common.controller;

import com.xhs.common.param.IdParam;
import com.xhs.core.message.ReturnResult;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @desc: 参数校验案例二
 * @projectName: spring-boot3-demo
 * @author: xhs
 * @date: 2025-06-10 周二 13:59
 */
@Slf4j
@Validated
@RestController
public class CheckParamV2Controller {

    /**
     * 批量删除企业
     *
     * @param list 入参
     * @return ReturnResult<Object>
     */
    @PostMapping("/delete/v2")
    public ReturnResult<String> delete(@RequestBody @Valid @NotEmpty(message = "list不能为空") List<IdParam> list) {
        log.info("<---------- 参数校验案例二:{} ---------->", list);
        return ReturnResult.success("删除成功");
    }
}
